#include<bits/stdc++.h>
using namespace std;
const int M=1e5;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    long long n,ans=0;
    long long m[M];
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>m[i];
    }
    sort(m,m+n+1);
    /*for(int i=1;i<=n;i++){
        cout<<m[i]<<" ";
    }
    cout<<endl;*/
    for(int i=1;i<=n;i++){
        if(m[i] <= m[n-i-1]){
            ans++;
        }
    }
    cout<<ans<<endl;
    fclose(stdin);
    fclose(stdout);
    return 0;
}
/*if(m[i]==1){
    x++;
}
if(m[i]==2){
    y++;
}
if(x+y ==n){
    if(x==y){
        cout<<
    }
}*/
/*if(i==0){
    if(m[i]<=m[i+1]){
        ans++;
        }
}
else if (i == n-1){
    if (m[i]>=m[n-1]){
        ans++;
    }*/

